//q3.cpp
//This programs capture an array and print the longest series which goes down.
//
//Binyamin 11 Jan 2018
//===========================================================================

#include<iostream>

using namespace std;

const int SIZE = 50;

//1. prompt the user for an array.
//2. capture the array, end on -1
//3. count the longest series which goes down.
int main()
{
	int size; // used to go over the current member of the array.
	int arr[SIZE]; // user input.
	int temp; // current member for the input stream.
	int count, max_count; // counting the down series.

	size = 0;
	count = 1;
	max_count = 1;
	cout << "Please enter the arrays member, end with -1" << endl;
	cin >> temp;
	if(temp != -1)
	{
		arr[size] = temp;
		size++;
		cin >> temp;
	}
	while(temp != -1)
	{
		arr[size] = temp;
		if(arr[size]<=arr[size-1]) count++;
		else count = 1;
		if(count> max_count) max_count = count;
		size++;
		cin >> temp;

	}
	cout << "The biggest series is of size " << max_count << endl;

}
//output
//Please enter the arrays member, end with -1
//5 3 1 4 6 4 3 2 -1
//The biggest series is of size 4
